package hust.ning.log;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import java.util.logging.Formatter;
import java.util.logging.LogRecord;


public class MyFormatter  extends Formatter{
	private static final SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
	static {
		sdf.setTimeZone(TimeZone.getTimeZone("GMT+8"));
	}
	@Override
	public String format(LogRecord logRecord) {
		return sdf.format( new Date(logRecord.getMillis()))+" "+
		logRecord.getLevel()+": "+logRecord.getMessage()+"\n";
	}
}
